home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 April / EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso / EARCD / comm / bbs / Hydra11s.lha / HBBS / Source / Doors_System / XPR / XPRD_Source / pn.c < prev    next >
C/C++ Source or Header  |  1996-06-25  |  565b  |  26 lines

  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <proto/dos.h>
  4. #include <proto/exec.h>
  5.  
  6. static void getpathname(BPTR lock,char *array)
  7. {
  8.     struct FileInfoBlock *fib=AllocMem(sizeof(struct FileInfoBlock),0);
  9.     BPTR newlock;
  10.     if(!fib||!lock) goto xit;
  11.     Examine(lock,fib);
  12.     getpathname(newlock=ParentDir(lock),array);            
  13.     strcat(array,fib->fib_FileName);
  14.     strcat(array,(newlock)?"/":":");
  15. xit:
  16.     if(fib) FreeMem(fib,sizeof(struct FileInfoBlock));
  17.     if(lock) UnLock(lock);
  18.     return;
  19. }
  20.  
  21. void getcdname(char *buffer)
  22. {
  23.     *buffer=0;
  24.     getpathname(Lock("",SHARED_LOCK),buffer);
  25. }    
  26.